<?php

declare( strict_types = 1 );
/**
 * This file is part of Hyperf.
 *
 * @link     https://www.hyperf.io
 * @document https://doc.hyperf.io
 * @contact  group@hyperf.io
 * @license  https://github.com/hyperf-cloud/hyperf/blob/master/LICENSE
 */

use Hyperf\HttpServer\Router\Router;

Router::addRoute(['GET', 'POST', 'HEAD'], '/', 'App\Controller\IndexController@index');
// api
Router::addGroup('/api',function (){
	// 路由组件不支持前缀路由，暂时使用这种方式实现miss效果，最多支持10层
	Router::addRoute( [ 'GET', 'POST', 'options' ], '/{name1}','App\Controller\Api@index' );
	Router::addRoute( [ 'GET', 'POST', 'options' ], '/{name1}/{name2}','App\Controller\Api@index' );
	Router::addRoute( [ 'GET', 'POST', 'options' ], '/{name1}/{name2}/{name3}','App\Controller\Api@index' );
	Router::addRoute( [ 'GET', 'POST', 'options' ], '/{name1}/{name2}/{name3}/{name4}','App\Controller\Api@index' );
	Router::addRoute( [ 'GET', 'POST', 'options' ], '/{name1}/{name2}/{name3}/{name4}/{name5}','App\Controller\Api@index' );
	Router::addRoute( [ 'GET', 'POST', 'options' ], '/{name1}/{name2}/{name3}/{name4}/{name5}/{name6}','App\Controller\Api@index' );
	Router::addRoute( [ 'GET', 'POST', 'options' ], '/{name1}/{name2}/{name3}/{name4}/{name5}/{name6}/{name7}','App\Controller\Api@index' );
	Router::addRoute( [ 'GET', 'POST', 'options' ], '/{name1}/{name2}/{name3}/{name4}/{name5}/{name6}/{name7}/{name8}','App\Controller\Api@index' );
	Router::addRoute( [ 'GET', 'POST', 'options' ], '/{name1}/{name2}/{name3}/{name4}/{name5}/{name6}/{name7}/{name8}/{name9}','App\Controller\Api@index' );
	Router::addRoute( [ 'GET', 'POST', 'options' ], '/{name1}/{name2}/{name3}/{name4}/{name5}/{name6}/{name7}/{name8}/{name9}/{name10}','App\Controller\Api@index' );
	/*
	Router::addRoute( [ 'POST', 'options' ], '','App\Controller\Api@index' );
	Router::addRoute( [ 'POST', 'options' ], '/','App\Controller\Api@index' );
	Router::addRoute( [ 'POST', 'options' ], '/v1','App\Controller\Api@index' );
	Router::addRoute( [ 'POST', 'options' ], '/v1/user/webCommonManage','App\Controller\Api@index' );
	Router::addGroup('/user',function (){
		Router::addRoute( [ 'POST', 'options' ], '/webCommonManage','App\Controller\Api@index' );
	});
	*/
}, [ 'middleware' => [ \App\Middleware\CorsMiddleware::class ] ] );
//